<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<title>行业联谊-内推招聘</title>
	<link rel="icon" href="favicon.ico" type="image/ico">
	<meta name="keywords" content="新闻管理">
	<meta name="author" content="yinqi">
	<link href="/css/bootstrap.min.css" rel="stylesheet">
	<link href="/css/materialdesignicons.min.css" rel="stylesheet">
	<link href="/css/style.min.css" rel="stylesheet">
	<style>
		table{
			table-layout:fixed;
		}

		td{
			overflow:hidden;
			text-overflow:ellipsis;
			white-space:nowrap;
		}
	</style>

</head>
<body>


<div class="row">
	<div class="col-lg-12">

		<div class="card">
			<div class="card-header"><h4>行业联谊-内推招聘</h4></div>
			<div class="card-toolbar clearfix">
				<form class="pull-right search-bar" action='/job/getAllJob' id="form3" method='post' role="form">
					<input type="hidden" name="page" id="pageNo" th:value="${page}">
					<table>
						<tr>

							<td th:width="300px">
								<select class="form-control" id="desc" name="cid" size="1" >
									<option value="0" th:selected="${queryObj.cid==0}">默认顺序</option>
									<option value="1" th:selected="${queryObj.cid==1}">最新排序</option>
									<option value="2" th:selected="${queryObj.cid==2}">最早排序</option>
								</select>
							</td>
							<td th:width="30px"> </td>

							<td th:width="300px">
								<div class="input-group">
									<input type="text" class="form-control" th:value="${queryObj.getKeyword()}"
										   name="keyword" placeholder="请输入名称">
									<span class="input-group-btn">
                          <button class="btn btn-default" type="submit">查询</button></span>
								</div>
							</td>


						</tr>

						<!--								<input type="hidden" name="search_field" id="search-field" value="title">-->


					</table>
				</form>
				<div class="toolbar-btn-action">
					<a class="btn btn-danger" href="javascript:delCus()" id="delCus"><i class="mdi mdi-window-close"></i> 删除</a>
				</div>
			</div>
			<div class="card-body">
				<form name="form2" id="fm3" action="/job" method="post">
					<div class="table-responsive">
						<table class="table table-bordered">
							<thead>
							<tr>
								<th>
									<label class="lyear-checkbox checkbox-primary">
										<input type="checkbox" id="check-all" ><span></span>
									</label>
								</th>
								<th>序号</th>
								<th>职位名称</th>
								<th>详细介绍</th>
								<th>发布人</th>
								<th>发布时间</th>
								<th>审核状态</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<tr th:each="job : ${jobPage.getRecords()}">

								<td>
									<label class="lyear-checkbox checkbox-primary">
										<input type="checkbox" name="jobId" th:value="${job.jobId}"><span></span>
									</label>
								</td>
								<td th:text="${jobStat.count}">1</td>
								<td th:text="${job.jobName}"></td>
								<!--<td><img th:src="${stu.stuImg}" alt="没有头像" width="20px" height="20px"></td>-->
								<td style="width:80px" th:text="${job.jobDesc}">《倚天屠龙记》</td>

								<td th:text="${job.tbStu.name}">36</td>
								<td th:text="${#temporals.format(job.jobTime,'yyyy-MM-dd HH:mm:ss')}"></td>
								<td>
									<span th:if="${job.checkStatus}==0">未审核</span>
									<span th:if="${job.checkStatus}==1">已通过</span>
									<span th:if="${job.checkStatus}==2">未通过</span>
								</td>
								<td>
									<div class="btn-group btn-group-sm">
										<a class="btn btn-info" th:onclick="'javascript:getJobById('+${job.checkStatus}+','+${job.jobId}+')'"  title="审核" ><i class="mdi mdi-pencil"></i></a>
										<a class="btn  btn-danger" th:href="@{'/job/delJobById?jobId='+${job.jobId}}" title="删除" ><i class="mdi mdi-window-close"></i></a>
									</div>
								</td>
							</tr>
							</tbody>
						</table>
					</div>
				</form>
				<div class="pagination">

					<div id="myPage"></div>
					<link rel="stylesheet" type="text/css" href="/js/page/jquery.sPage.css">
					<script type="text/javascript"
							src="/js/jquery.min.js"></script>
					<script type="text/javascript"
							src="/js/page/jquery.sPage.min.js"></script>
					<script type="text/javascript" th:inline="javascript">
                        //初始化分页组件

                        $("#myPage").sPage({

                            page:[[${page}]],//当前页码，必填
                            total:[[${jobPage.getTotal()}]],//数据总条数，必填
                            pageSize:[[${jobPage.getSize()}]],//每页显示多少条数据，默认10条
                            totalTxt:"共"+[[${jobPage.getTotal()}]]+"条",//数据总条数文字描述，{total}为占位符，默认"共{total}条"
                            showTotal:true,//是否显示总条数，默认关闭：false
                            showSkip:true,//是否显示跳页，默认关闭：false
                            showPN:true,//是否显示上下翻页，默认开启：true
                            prevPage:"上一页",//上翻页文字描述，默认“上一页”
                            nextPage:"下一页",//下翻页文字描述，默认“下一页”
                            backFun:function(page){
                                //点击分页按钮回调函数，返回当前页码
                                console.log(page);
                                $("#pageNo").val(page);
                                $("#form3").submit();
                            }
                        });

                        //回调方法:点击上一页和下一页
                        function handlePaginationClick(new_page_index, pagination_container) {
                            $("#pageNo").val(new_page_index + 1);
                            $("#form3").submit();
                        }

                        $(function () {
                            $("#check-all").click(function () {
                                if(this.checked){
                                    $("input[name=jobId]").prop("checked",true);
                                }
                                else {
                                    $("input[name=jobId]").prop("checked",false);
                                }

                            });
                            $("#checkrev").click(function () {
                                $("input[name=jobId]").each(function () {
                                    $(this).prop("checked",!$(this).prop("checked"))
                                });
                            })
                        });

                        function getJobById(a,jobId) {
                            if(a!=1) {
                                location.href = "/job/getJobById?jobId=" + jobId;
                            }
                            else {
                                alert("不能重复审核！")
							}
                        }

                        function lookJobById(jobId) {
                            //location.href="/job/lookJobById?jobId="+jobId;
                        }

                        function delCus() {
                            $("#fm3").prop("action","/job/delJobById");
                            var len=$("input[name=jobId]:checked").length;
                            if(len>0){
                                if(confirm("将要删除的所有岗位信息?")){
                                    $("#fm3").submit();
                                }
                            }else {
                                alert("你还没有选中")
                            }
                        }
                        function exp() {
                            $("#fm3").prop("action","stu/expexl");
                            var len=$("input[name=jobId]:checked").length;
                            if(len>0){
                                if(confirm("是否要生成表格")){
                                    $("#fm3").submit();
                                }
                            }else {
                                alert("你还没有选中")
                            }
                        }
					</script>

				</div>

			</div>
		</div>
	</div>

</div>


<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
</body>
</html>